<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    onload=function(){
        var star=myform.star;
        myform.but.onclick=function(){
            if(star.value==""){
                alert("请选择答案");
            }else if(star.value=="黄渤"){
                alert("答案正确");
            }else{
                alert("答案不正确");
            }
        }
    }
</script>
<form name="myform">
    电影《疯狂的外星人》的主演是谁？
    <p>
        <input type="radio" name="star" value="邓超">邓超
        <input type="radio" name="star" value="黄渤">黄渤
        <input type="radio" name="star" value="徐峥">徐峥
        <input type="radio" name="star" value="王宝强">王宝强
    </p>
    <input type="button" name="but" value="提交答案">
</form>
</body>
</html>